<?

/**
* local collection functions of tocmenu_611
*
* @author Adesanto Asman
* @version 1.0
* @license Free
* @copyright Copyright (c)2007, Adesanto Asman
* @package CLocal
*
*/

/**
* @package CLocal
*
*/
class CLocal{

  /**
   * add a row
   *
   * @param integer  $source
   * @param integer  $adder
   * @return  integer
   */
  function addRow($source, $adder){

    return $source += $adder;
  }

  /**
   * filter out the zero balance
   * from available list
   *
   * @param array $source
   */
  function filterZeroBalance(&$source){

    $dropBox  = array();
    $lstKey   = array();
    $maxRow   = sizeof($source["QTY"]);

    /**
     * get the index of zero balance qty
     */
    for($iRow = 0; $iRow < $maxRow ; $iRow++){

      if($source["QTY"][$iRow] == 0){

        /**
         * since drop process doesn't take
         * 0 start index then we need
         * to adjust by 1 to synced
         */
        array_push($dropBox, ($iRow+_ARRAY_NUMBER));
      }else{

        /*Do nothing*/
      }
    }

    foreach($source as $list => $value){

      array_push($lstKey, $list);
    }
    unset($list);
    unset($value);

    GlobalProcessors::dropArray($source,
                                $lstKey,
                                $dropBox);
  }
}

?>